/**
  err.h - Created by Timothy Morey on 6/21/2012
*/

#ifndef __ERR_H
#define __ERR_H

#include "libnvn.h"

#define NVN_NOERR          0
#define NVN_ERROR          1
#define NVN_EINVARGS       2
#define NVN_ETHREADFAIL    3
#define NVN_ECONNFAIL      4
#define NVN_ECOMMFAIL      5
#define NVN_ESMALLBUF      6
#define NVN_EINVTYPE       7
#define NVN_EINVARCH       8
#define NVN_ENOTAMSG       9
#define NVN_EMAXOBJS      10
#define NVN_EINVSTRING    11
#define NVN_EWIN32FAIL    12
#define NVN_EWGLFAIL      13
#define NVN_EGLEWFAIL     14
#define NVN_EOPENGLFAIL   15
#define NVN_EWINSOCKFAIL  16
#define NVN_EINVCLARGS    17
#define NVN_EUSERCANCELED 18
#define NVN_EINVFRAME     19
#define NVN_EGLXFAIL      21
#define NVN_EXWINFAIL     22
#define NVN_EPINGFAIL     23
#define NVN_ENETCDFFAIL   24
#define NVN_ENOTIMPL      25

static const char *g_ErrMsg[] = {
  "No error",
  "An error occurred",
  "Invalid arguments",
  "Failed to start thread",
  "Connection failed",
  "Communication error",
  "Supplied buffer is too small",
  "Invalid type",
  "Architecture not supported",
  "The string is not an XML message",
  "The maximum number of objects has been reached",
  "Invalid string format",
  "A Win32 function returned an error code",
  "A Win32 OpenGL function returned an error code",
  "An OpenGL Extension Wrangler (GLEW) function returned an error code",
  "An OpenGL function returned an error code",
  "A WinSock function returned an error code",
  "The program was invoked with invalid command line arguments",
  "The user canceled the execution",
  "The current frame for the layer is not valid",
  "A GLX function returned an error code",
  "An X-Windows function returned an error code",
  "Unable to ping the destination",
  "A NetCDF function returned an error code",
  "The requested feature is not yet implemented",
};

EXPORT int WriteErrorMessage(int err, const char* msg);

#endif
